/**
 * Created by Administrator on 2018/8/20.
 */
// 引入mockjs
const Mock = require('mockjs')
// 获取 mock.Random 对象
const Random = Mock.Random
// mock一组数据
const produceNewsData = function () {
  let articles = []
  for (let i = 0; i < 100; i++) {
    let newArticleObject = {
      title: Random.csentence(5, 30), //  Random.csentence( min, max )
      thumbnail_pic_s: Random.dataImage('300x250', 'mock的图片'), // Random.dataImage( size, text ) 生成一段随机的 Base64 图片编码
      author_name: Random.cname(), // Random.cname() 随机生成一个常见的中文姓名
      date: Random.date() + ' ' + Random.time() // Random.date()指示生成的日期字符串的格式,默认为yyyy-MM-dd；Random.time() 返回一个随机的时间字符串
    }
    articles.push(newArticleObject)
  }

  return {
    articles: articles,
    status: 200
  }
}

// Mock.mock( url, post/get , 返回的数据)；
Mock.mock('/news/index', 'post', produceNewsData)
// 登陆接口
Mock.mock('/login', 'post', function () {
  return {
    success: true,
    data: {
      msg: '账号或密码错误',
      token: '11111111111111111111'
    },
    status: 200
  }
})
Mock.mock('/loginOut', 'post', function () {
  return {
    success: true,
    data: {
      msg: '注销失败'
    },
    status: 200
  }
})
Mock.mock('/getMenu', 'post', function () {
  return {
    menList: [
      {id: '01', pId: '0', name: '首页', url: 'modules/home/home', icon: 'el-icon-menu'},
      {id: '1', pId: '0', name: '拓扑态势呈现', url: '', icon: 'el-icon-location'},
      {id: '11', pId: '1', name: '网络拓扑呈现', url: 'modules/topo/netWorkTopo/netWorkTopo', icon: 'el-icon-location'},
      {id: '12', pId: '1', name: '运行状态展现', url: 'modules/topo/opStatusDis/opStatusDis', icon: 'el-icon-location'},
      {id: '13', pId: '1', name: '故障告警呈现', url: 'modules/topo/faultWaringPre/faultWaringPre', icon: 'el-icon-location'},
      {id: '2', pId: '0', name: '故障告警管理', url: '', icon: 'el-icon-location'},
      {id: '21', pId: '2', name: '告警故障监视', url: 'modules/faultWarning/alermFalMon/alermFalMon', icon: 'el-icon-location'},
      {id: '22', pId: '2', name: '远程故障诊断', url: 'modules/faultWarning/remoteMai/remoteMai', icon: 'el-icon-location'},
      {id: '23', pId: '2', name: '故障辅助处置', url: 'modules/faultWarning/faultAidDis/faultAidDis', icon: 'el-icon-location'},
      {id: '24', pId: '2', name: '历史故障查询', url: 'modules/faultWarning/historyFauQue/historyFauQue', icon: 'el-icon-location'},
      {id: '3', pId: '0', name: '运行质量分析', url: '', icon: 'el-icon-setting'},
      {id: '31', pId: '3', name: '性能主动测量', url: 'modules/qualityAnalysis/performaceMea/performaceMea', icon: 'el-icon-location'},
      {id: '32', pId: '3', name: '综合指标处理', url: 'modules/qualityAnalysis/targetHandle/targetHandle', icon: 'el-icon-location'},
      {id: '33', pId: '3', name: '综合指标分析', url: 'modules/qualityAnalysis/targetAna/targetAna', icon: 'el-icon-location'},
      {id: '4', pId: '0', name: '系统配置管理', url: '', icon: 'el-icon-setting'},
      {id: '41', pId: '4', name: '用户管理', url: 'modules/system/user/user', icon: 'el-icon-setting'},
      {id: '42', pId: '4', name: '角色管理', url: 'modules/system/role/role', icon: 'el-icon-setting'},
      {id: '43', pId: '4', name: '权限管理', url: 'modules/system/power/power', icon: 'el-icon-setting'},
      {id: '44', pId: '4', name: '安全设置', url: 'modules/system/safe/safe', icon: 'el-icon-setting'},
      {id: '45', pId: '4', name: '组织维护', url: 'modules/system/organizationMai/organizationMai', icon: 'el-icon-setting'},
      {id: '46', pId: '4', name: '地理维护', url: 'modules/system/geographyMai/geographyMai', icon: 'el-icon-setting'},
      {id: '48', pId: '4', name: '业务软件管理', url: 'modules/system/business/business', icon: 'el-icon-setting'},
      {id: '49', pId: '4', name: '代理端管理', url: 'modules/system/agent/agent', icon: 'el-icon-setting'},
      {id: '50', pId: '4', name: '运维层级管理', url: 'modules/system/operation/operation', icon: 'el-icon-setting'},
      {id: '51', pId: '4', name: '系统日志', url: 'modules/system/log/log', icon: 'al-icon al-icon-playon_fill'}
    ],
    success: true,
    status: 200
  }
})
